﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;

namespace Vehicle.DAL
{
    /// <summary>
    /// Copyright (C) M-Tear团队
    /// 文 件 名：Post.cs
    /// 版    本：v1.00.0000
    /// 创建标识：2009-09-05    Created by 孙成杰 V1.00.0000
    /// 功能说明：Post表数据层类（继承于数据层基类)
    /// 注意事项：无
    /// 更新记录：
    /// </summary>
    public class Post : Base_DAL, Vehicle.Interface.IPost
    {

        /// <summary>
        /// 通过时间和标题查询绑定页面Repeater控件
        /// </summary>
        /// <param name="rep">Repeater控件对象</param>
        /// <param name="m_ComponentsInfo">通用实体对象</param>
        public void RepeaterBindSearch(Repeater rep, Model.ComponentsInfo m_ComponentsInfo)
        {
           
            rep.DataSource = GetAllSearch(new Model.ComponentsInfo(m_ComponentsInfo.startIndex, m_ComponentsInfo.endIndex, "Post", m_ComponentsInfo.condition, m_ComponentsInfo.result, m_ComponentsInfo.Tcondition, m_ComponentsInfo.Tresult, m_ComponentsInfo.Scondition, m_ComponentsInfo.Sresult, "P_Time","P_Title",m_ComponentsInfo.TCount, m_ComponentsInfo.StartTime, m_ComponentsInfo.EndTime, "P_ID")).DefaultView;
            rep.DataBind();
        }

        /// <summary>
        /// 添加公告数据
        /// </summary>
        /// <param name="m_PostInfo">实体对象</param>
        public void Add(Model.PostInfo m_PostInfo)
        {
            string SpName = "Post_ADD";
            object[] _object = new object[] { 0, m_PostInfo.P_Title, m_PostInfo.P_Time, m_PostInfo.P_Name, m_PostInfo.P_Note };
            SqlHelper.ExecuteNonQuery(SpName, _object);
        }

        /// <summary>
        ///  修改公告数据
        /// </summary>
        /// <param name="m_PostInfo">实体对象</param>
        public void Update(Model.PostInfo m_PostInfo)
        {
            string SpName = "Post_Update";
            object[] _object = new object[] { 0, m_PostInfo.P_ID, m_PostInfo.P_Title, m_PostInfo.P_Name, m_PostInfo.P_Note };
            SqlHelper.ExecuteNonQuery(SpName, _object);
        }
    }
}


    
      